﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace ServiceProviderPractice
{
    class MockComponent :IComponent
    {
        public void MockMethod()
        {
            var productService = GetService<IProductServcie>();
            productService.Perform();
        }
        private T GetService<T>()
        {
            return (T) Site.GetService(typeof (T));
        }

        public void Dispose()
        {
            throw new System.NotImplementedException();
        }

        public event EventHandler Disposed;
        public ISite Site
        {
            get; set;
        }
    }
}
